package com.jml.mapper;

import org.apache.ibatis.annotations.*;

import com.jml.entity.OrderEntity;

public interface OrderMapper {

    @Insert(value = "INSERT INTO `order_info` VALUES (#{id}, " +
            "#{name}, #{orderCreatetime}, #{orderMoney}, #{orderState}, #{commodityId},#{orderId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    public int addOrder(OrderEntity orderEntity);

    @Update({
            "<script>",
            "UPDATE order_info ",
            " set ",
            "   orderMoney = 123321 ",
             "</script>",
    })
    public int updateOrder();

    @Select("SELECT * from order_info where orderId=#{orderId};")
    public OrderEntity findOrderId(@Param("orderId") String orderId);

}
